package com.ruoyi.shop.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.ShopAdMapper;
import com.ruoyi.shop.domain.ShopAd;
import com.ruoyi.shop.service.IShopAdService;
import com.ruoyi.common.core.text.Convert;

/**
 * 广告Service业务层处理
 * 
 * @author Alan Zhang
 * @date 2021-09-12
 */
@Service
public class ShopAdServiceImpl implements IShopAdService 
{
    @Autowired
    private ShopAdMapper shopAdMapper;

    /**
     * 查询广告
     * 
     * @param id 广告主键
     * @return 广告
     */
    @Override
    public ShopAd selectShopAdById(Long id)
    {
        return shopAdMapper.selectShopAdById(id);
    }

    /**
     * 查询广告列表
     * 
     * @param shopAd 广告
     * @return 广告
     */
    @Override
    public List<ShopAd> selectShopAdList(ShopAd shopAd)
    {
        return shopAdMapper.selectShopAdList(shopAd);
    }

    /**
     * 新增广告
     * 
     * @param shopAd 广告
     * @return 结果
     */
    @Override
    public int insertShopAd(ShopAd shopAd)
    {
        return shopAdMapper.insertShopAd(shopAd);
    }

    /**
     * 修改广告
     * 
     * @param shopAd 广告
     * @return 结果
     */
    @Override
    public int updateShopAd(ShopAd shopAd)
    {
        return shopAdMapper.updateShopAd(shopAd);
    }

    /**
     * 批量删除广告
     * 
     * @param ids 需要删除的广告主键
     * @return 结果
     */
    @Override
    public int deleteShopAdByIds(String ids)
    {
        return shopAdMapper.deleteShopAdByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除广告信息
     * 
     * @param id 广告主键
     * @return 结果
     */
    @Override
    public int deleteShopAdById(Long id)
    {
        return shopAdMapper.deleteShopAdById(id);
    }
}
